<?php 
/**
 * 注册模型
 */
class MemberModel extends Model{
	//指定表明
	public $table = 'user';
	public $validate=array(
		array('username_reg','nonull','注册用户名不能为空',1,1),
		array('password_reg1','nonull','密码不能为空',1,1),
		array('password_reg2','nonull','二次密码不能为空',1,1),
		array('code','nonull','验证码不能为空',1,1),
		array('username','nonull','登录用户名不能为空',1,1),
		array('password','nonull','登录密码不能为空',1,1),
		
	); 
	/**
	 * 添加
	 */
	public function addUser(){
		$username = Q('post.username');
		$password = Q('post.pwd','','md5');
		$this->add(
			array('username'=>"{$username}",'pwd'=>"{$pwd}")
		);
		return true;
	} 
	
	
	


	
	
	
	
	
}


 ?>